<%@page import="com.situ.web.entity.Banji"%>

 
<%@page import="java.util.ArrayList"%>

 
<%@ page language="java" contentType="text/html; charset=UTF-8"

 
    pageEncoding="UTF-8"%>

 
<!DOCTYPE html>

 
<html>

 
<head>

 
<meta charset="UTF-8">

 
<title>Insert title here</title>

 
<link rel="stylesheet" type="text/css" href="bootstrap-3.3.7-dist/css/bootstrap.css"/>
<script type="text/javascript">
	function dianwo(){
	var num = document.getElementById("1").value;

	location.href= "/JAVA_WEB_1907/banji?method=sousuo&num="+num;
	}
</script>
 
</head>
		
 
<body>

 
	
		
 	 <input type = "text"id = "1"/><input type="button" onclick="dianwo()" value="搜索"/><br/>
	 <a href="<%=request.getContextPath()%>/banji_insert.jsp" class="btn btn-success">添加</a>

 
	<table class="table table-striped table-bordered table-hover table-condensed">

 
		<tr>

 
			<td>ID</td>

 
			<td>名字</td>

 
			<td>删除</td>

 
			<td>修改</td>

 
		</tr>

 
		<%

 
			ArrayList<Banji> list = (ArrayList<Banji>)request.getAttribute("list");

 
			for (Banji banji : list) {

 
		%>

 
				<tr>

 
					<td><%=banji.getId()%></td>

 
					<td><%=banji.getName()%></td>

 
					<td><a href="javascript:void(0)" onclick="deleteById(<%=banji.getId()%>)">删除</a></td>

 
					<td><a href="javascript:void(0)" onclick="xiugai(<%=banji.getId()%>)">修改</a></td>

 
				</tr>

 
		<%

 
			}

 
		%>

 
	</table>

 
	

 
	<script type="text/javascript">

 
		function deleteById(id) {

 
			var isDel = confirm("您确认要删除么？");

 
			if (isDel) {

 
 
				location.href = "/JAVA_WEB_1907/banji?method=deleteById&id=" + id;

 
			}

 
		}
		function xiugai(id){
			var isDel = confirm("您确认要修改？");

			 
			if (isDel) {

			location.href=	"/JAVA_WEB_1907/banji?method=toUpdate&id="+ id;
			//location.href = "/JAVA_WEB_1907/banji?method=xiugai&id=" + id;
		//	location.href=	"/JAVA_WEB_1907/banji_xiugai.jsp&id="+ id;

 
			}
			
			
		}
 
	</script>

 
</body>

 
</html>